﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage<GabageFactory.Models.tailingpond_analysis_detail>" %>

<asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server">
	尾矿库分析报告填写
</asp:Content>

<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">

    <% 
        analysis_reporting_list reporting = (analysis_reporting_list)ViewData["reporting"];
        Tailingpond tailingpond = (Tailingpond)ViewData["tailingpond"];
        tailingpond_analysis_detail detail = (tailingpond_analysis_detail)ViewData["detail"];
        using (Html.BeginForm("SaveTailingpond", "Reporting", FormMethod.Post, new { id = "inputForm", enctype = "multipart/form-data" }))
        {%>
        <%= Html.ValidationSummary(true)%>
        <%= Html.HiddenFor(model => model.id)%>
      
    <div style="margin-top:10px">
        报告完成时间：<%=reporting.finishedTime.Value.Year%>-<%=reporting.finishedTime.Value.Month%>-<%=reporting.finishedTime.Value.Day%>
        <span style="margin-left:30px">报告状态：<%= reporting.status == 2 || reporting.status == 3 ? "发布稿" : "草稿"%></span>
    </div>

    <h2 class="view_title" style=" width:856px;"><%=tailingpond.Name%>尾矿库<%=reporting.date.Month%>月监控报告</h2>
    
    <div class="title_split"><strong>初步判断</strong></div>
    <table cellpadding="4" cellspacing="0" class="com_from_table" style="width:856px;">
        <tr>
            <th style="text-align:center;">监测项</th>
            <th style="text-align:center;">正常</th>
            <th style="text-align:center;">异常</th>
            <th style="text-align:center;">异常情况补充说明</th>
        </tr>
        <tr>
            <td style="text-align:right; vertical-align:middle;">水位及水质</td>
            <td style="text-align:center; vertical-align:middle;"><input id="waterNormal" type="radio" name="water" value="0" <%if (Model.water == 0) { %>checked="checked" <%} %> /></td>
            <td style="text-align:center; vertical-align:middle;"><input id="waterInnormal" type="radio" name="water" value="1" <%if (Model.water == 1) { %>checked="checked" <%} %> /></td>
            <td><%= Html.TextAreaFor(model => model.water_desc, new { cols="80", rows="3" })%></td>
        </tr>
        <tr>
            <td style="text-align:right; vertical-align:middle;">进浆及回水</td>
            <td style="text-align:center; vertical-align:middle;"><input id="backWaterNormal" type="radio" name="backwater" value="0" <%if (Model.backwater == 0) { %>checked="checked" <%} %> /></td>
            <td style="text-align:center; vertical-align:middle;"><input id="backWaterInnormal" type="radio" name="backwater" value="1" <%if (Model.backwater == 1) { %>checked="checked" <%} %> /></td>
            <td><%= Html.TextAreaFor(model => model.backwater_desc, new { cols="80", rows="3" })%></td>
        </tr>
        <tr>
            <td style="text-align:right; vertical-align:middle;">沉降及位移</td>
            <td style="text-align:center; vertical-align:middle;"><input id="ditchNormal" type="radio" name="ditch" value="0" <%if (Model.ditch == 0) { %>checked="checked" <%} %> /></td>
            <td style="text-align:center; vertical-align:middle;"><input id="ditchInnormal" type="radio" name="ditch" value="1" <%if (Model.ditch == 1) { %>checked="checked" <%} %> /></td>
            <td><%= Html.TextAreaFor(model => model.ditch_desc, new { cols="80", rows="3" })%></td>
        </tr>
        <tr>
            <td style="text-align:right; vertical-align:middle;">尾矿堆积坝</td>
            <td style="text-align:center; vertical-align:middle;"><input id="filldamNormal" type="radio" name="filldam" value="0" <%if (Model.filldam == 0) { %>checked="checked" <%} %> /></td>
            <td style="text-align:center; vertical-align:middle;"><input id="filldamInnormal" type="radio" name="filldam" value="1" <%if (Model.filldam == 1) { %>checked="checked" <%} %> /></td>
            <td><%= Html.TextAreaFor(model => model.filldam_desc, new { cols="80", rows="3" })%></td>
        </tr>
    </table>

    <div class="title_split"><strong>总结报告</strong></div>
    <div style="width:856px;">
        <%= Html.TextAreaFor(model=>model.summary, new { cols = 50, rows = 20, id = "CKEditor1" })%>
    </div>

    <div class="title_split"><strong>建议</strong></div>
    <div style="width:856px;">
        <%= Html.TextAreaFor(model=>model.suggestion, new { cols = 50, rows = 20, id = "CKEditor2" })%>
    </div>

    <div style="margin-top:20px">
        上传报告:<input type="file" style="width:778px;" name="doc" /> <%if (!string.IsNullOrEmpty(Model.doc)) { %>(<a href="<%=Url.Content(Model.doc) %>">查看报告</a>)<%} %>
    </div>

    <div class="submit_btn_area" style="margin-left:172px;">
        <%=Html.Hidden("action", 0)%>
        <input type="button" value="保 存" onclick="save();" />
        <input type="button" value="预发布" onclick="prePublish();" style="margin-left:25px" />
    </div>

    <% } %>

        <script type="text/javascript">
            window.CKEDITOR_BASEPATH = '/ckeditor/';
    </script>
    <script src="../../ckeditor/ckeditor.js" type="text/javascript"></script>
    <script type="text/javascript">
        var CKEditor_Controls = [], CKEditor_Init = [];
        function CKEditor_TextBoxEncode(d, e) {
            var f;
            if (typeof CKEDITOR == 'undefined' || typeof CKEDITOR.instances[d] == 'undefined') {
                f = document.getElementById(d);
                if (f) f.value = f.value.replace(/</g, '&lt;').replace(/>/g, '&gt;');
            } else {
                var g = CKEDITOR.instances[d];
                if (e && (typeof Page_BlockSubmit == 'undefined' || !Page_BlockSubmit)) {
                    g.destroy();
                    f = document.getElementById(d);
                    if (f) f.style.visibility = 'hidden';
                }
                else g.updateElement();
            }
        };
        (function () { if (typeof CKEDITOR != 'undefined') { var d = document.getElementById('CKEditor1'); if (d) d.style.visibility = 'hidden'; } var e = function () { var f = CKEditor_Controls, g = CKEditor_Init, h = window.pageLoad, i = function () { for (var j = f.length; j--; ) { var k = document.getElementById(f[j]); if (k && k.value && (k.value.indexOf('<') == -1 || k.value.indexOf('>') == -1)) k.value = k.value.replace(/&lt;/g, '<').replace(/&gt;/g, '>').replace(/&amp;/g, '&'); } if (typeof CKEDITOR != 'undefined') for (var j = 0; j < g.length; j++) g[j].call(this); }; window.pageLoad = function (j, k) { if (k.get_isPartialLoad()) setTimeout(i, 0); if (h && typeof h == 'function') h.call(this, j, k); }; if (typeof Page_ClientValidate == 'function' && typeof CKEDITOR != 'undefined') Page_ClientValidate = CKEDITOR.tools.override(Page_ClientValidate, function (j) { return function () { for (var k in CKEDITOR.instances) { if (document.getElementById(k)) CKEDITOR.instances[k].updateElement(); } return j.apply(this, arguments); }; }); setTimeout(i, 0); }; if (typeof Sys != 'undefined' && typeof Sys.Application != 'undefined') Sys.Application.add_load(e); if (window.addEventListener) window.addEventListener('load', e, false); else if (window.attachEvent) window.attachEvent('onload', e); })();
        CKEditor_Controls.push('CKEditor1');
        CKEditor_Init.push(function () { if (typeof CKEDITOR.instances['CKEditor1'] != 'undefined' || !document.getElementById('CKEditor1')) return; CKEDITOR.replace('CKEditor1', {"htmlEncodeOutput": true, "removePlugins": "elementspath", "toolbar": [["Undo", "Redo"], ["Bold", "Italic", "Underline", "Strike", "-", "Subscript", "Superscript"], ["JustifyLeft", "JustifyCenter", "JustifyRight", "JustifyBlock"], ["Styles", "Format", "Font", "FontSize"], ["TextColor", "BGColor", "Image"]] }); });

        CKEditor_Controls.push('CKEditor2');
        CKEditor_Init.push(function () { if (typeof CKEDITOR.instances['CKEditor2'] != 'undefined' || !document.getElementById('CKEditor2')) return; CKEDITOR.replace('CKEditor2', {"htmlEncodeOutput": true, "removePlugins": "elementspath", "toolbar": [["Undo", "Redo"], ["Bold", "Italic", "Underline", "Strike", "-", "Subscript", "Superscript"], ["JustifyLeft", "JustifyCenter", "JustifyRight", "JustifyBlock"], ["Styles", "Format", "Font", "FontSize"], ["TextColor", "BGColor", "Image"]] }); });


        function save() {
            $("#action").val(0);
            $("#inputForm").submit();
        }

        function prePublish() {
            $("#action").val(1);
            $("#inputForm").submit();
        }
    </script>
    
</asp:Content>
